home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
win
/
c
/
winclas.exe
/
WINCLS.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1991-07-06
|
1KB
|
44 lines
#include <windows.h>
#include "winclass.hpp"
long FAR PASCAL wndproc(HANDLE hWnd,unsigned message, WORD wParam,LONG lParam)
{
switch (message) {
case WM_DESTROY :
PostQuitMessage(0);
break;
default: return(DefWindowProc(hWnd,message,wParam,lParam));
}
return NULL;
}
int PASCAL WinMain(HANDLE hInstance,HANDLE hPrevInstance,LPSTR lpCmdLine, int nCmdShow)
{
MSG msg;
OverlappedWindow Test("Happy Face",hInstance,wndproc);
OverlappedWindow test2("Norris",hInstance,wndproc);
ModalWindow test3("This is Modal",hInstance,wndproc);
int windowsopen;
test3.SetInitialSize(100,100);
test3.Open(nCmdShow);
test2.SetIcon(LoadIcon(hInstance,"NORRIS"));
test2.Open(nCmdShow);
Test.SetInitialCursor(LoadCursor(NULL,IDC_CROSS));
Test.SetIcon(LoadIcon(hInstance,"WINDCLASS"));
Test.Open(nCmdShow);
windowsopen = 2;
while (windowsopen > 0)
{
while (GetMessage(&msg, NULL,NULL,NULL))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
windowsopen--;
}
return msg.wParam;
}